<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Bootstrap Admin</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="referrer" content="no-referrer"/>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="/static/lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/static/lib/font-awesome/css/font-awesome.css">

    <script src="/static/lib/jquery-1.11.1.min.js" type="text/javascript"></script>


    <link rel="stylesheet" type="text/css" href="/static/stylesheets/theme.css">
    <link rel="stylesheet" type="text/css" href="/static/stylesheets/premium.css">

</head>
<body class=" theme-blue">

<!-- Demo page code -->

<script type="text/javascript">
    $(function () {
        var match = document.cookie.match(new RegExp('color=([^;]+)'));
        if (match) var color = match[1];
        if (color) {
            $('body').removeClass(function (index, css) {
                return (css.match(/\btheme-\S+/g) || []).join(' ')
            })
            $('body').addClass('theme-' + color);
        }

        $('[data-popover="true"]').popover({html: true});
    });

    function photo_show(id) {
        var photos = window.document.getElementById("photos_show");
        $.ajax({
            url: '/eva_photo/?id=' + id,
            type: 'GET',
            dataType: 'json',
            success: function (photo_data) { //请求成功完成后要执行的方法
                console.log(photo_data);
                var str = '';
                if (!photo_data) {
                    photos.innerHTML = '';

                    function photo_show(id) {
                        var photos = window.document.getElementById("photos_show");
                        $.ajax({
                            url: '/eva_photo/?id=' + id,
                            type: 'GET',
                            dataType: 'json',
                            success: function (photo_data) { //请求成功完成后要执行的方法
                                console.log(photo_data);
                                var str = '';
                                if (!photo_data) {
                                    photos.innerHTML = '';
                                    return
                                }
                                for (photo in photo_data) {
                                    str += "<div class='col-xs-6 col-md-6'>" +
                                        "<a href=" + photo_data[photo] + " class='thumbnail'>" +
                                        "<img src=" + photo_data[photo] + " class='img-responsive'>"
                                        + "</a>"
                                        + "</div>"
                                }
                                console.log(str)
                                photos.innerHTML = str
                            }
                        })
                    }

                    return
                }
                for (photo in photo_data) {
                    str += "<div class='col-xs-6 col-md-6'>" +
                        "<a href=" + photo_data[photo] + " class='thumbnail'>" +
                        "<img src=" + photo_data[photo] + " class='img-responsive'>"
                        + "</a>"
                        + "</div>"
                }
                console.log(str)
                photos.innerHTML = str
            }
        })
    }

    function delcfm(url) {
        $('#url').val(url);//给会话中的隐藏属性URL赋值
    }

    function urlSubmit() {
        var url = $.trim($("#url").val());//获取会话中的隐藏属性URL
        console.log(url);
        window.location.href = url;
    }

</script>
<style type="text/css">

    .navbar-default .navbar-brand, .navbar-default .navbar-brand:hover {
        color: #fff;
    }
</style>

<script type="text/javascript">
    $(function () {
        var uls = $('.sidebar-nav > ul > *').clone();
        uls.addClass('visible-xs');
        $('#main-menu').append(uls.clone());
    });
</script>

<div id="url"></div>
<div class="navbar navbar-default" role="navigation" style="height: 80px;">
    <div class="navbar-header">
        <a class=""><span class="navbar-brand" style="font-size: 20px;font-weight:bold;"><img
                src="/static/images/schoolBadge.png"
                style="height: 55px;width: 55px" alt=""/> 干部信息录入系统</span></a>
    </div>
    <div class="navbar-collapse collapse" style="height: 1px;">
        <ul id="main-menu" class="nav navbar-nav navbar-right">
            <li class="dropdown hidden-xs">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <span class="glyphicon glyphicon-user padding-right-small"
                          style="position:relative;height: 49px;"></span>{{ user.user_name }}
                    <i class="fa fa-caret-down"></i>
                </a>
                <ul class="dropdown-menu">
                    <li><a tabindex="-1" href="/admin_loginout/">注销</a></li>
                </ul>
            </li>
        </ul>
    </div>
</div>


<div class="sidebar-nav">
    <ul>
        <li><a href="#" data-target=".dashboard-menu" class="nav-header" data-toggle="collapse"><i
                class="fa fa-fw fa-dashboard"></i> 用户管理<i class="fa fa-collapse"></i></a></li>
        <li>
            <ul class="dashboard-menu nav nav-list collapse">
                <li><a href="/admin_index/"><span class="fa fa-caret-right"></span>用户数据</a></li>
                <li><a href="/admin_userlist/"><span class="fa fa-caret-right"></span> 用户列表</a></li>
            </ul>
        </li>

        <li><a href="#" data-target=".premium-menu" class="nav-header collapsed" data-toggle="collapse"><i
                class="fa fa-fw fa-fighter-jet"></i> 评奖评优管理<i class="fa fa-collapse"></i></a></li>
        <li>
            <ul class="premium-menu nav nav-list collapse in">
                <li><a href="/admin_user_eva/"><span class="fa fa-caret-right"></span> 查看用户</a></li>
                <li><a href="/admin_eva_app/"><span class="fa fa-caret-right"></span> 未审核评优</a></li>
                <li><a href="/admin_eva_apped/"><span class="fa fa-caret-right"></span> 已通过评优</a></li>
                <li><a href="/admin_eva_unapp/"><span class="fa fa-caret-right"></span> 未通过评优</a></li>
            </ul>
        </li>
    </ul>
</div>

<div class="content">
    <div class="header">

        <h1 class="page-title">审核未通过列表</h1>


    </div>
    <div class="main-content">
        <table class="table">
            <thead>
            <tr>
                <th>序号</th>
                <th>申请人姓名</th>
                <th>申请人身份证号</th>
                <th>证书名称</th>
                <th>证书获得时间</th>
                <th style="width: 20em;"></th>
            </tr>
            </thead>
            <tbody>
            {% load dict_fun %}
            {% for app in app_list %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>{{ user_dict|dict_get:app.id|dict_get:'user_name' }}</td>
                    <td>{{ user_dict|dict_get:app.id|dict_get:'card_id' }}</td>
                    <td>{{ app.app_name }}</td>
                    <td>{{ app.app_data }}</td>
                    <td><a href="#myModal" role="button" data-toggle="modal"
                           onclick="photo_show({{ app.id }})"><i class="fa fa-search"></i>&nbsp;查看图片</a>
                        &nbsp;&nbsp;&nbsp;
                        <a href="#delModel" role="button" data-toggle="modal"
                           onclick="delcfm('/admin_eva_delapp/?id={{ app.id }}')"><i class="fa fa-trash-o"></i>&nbsp;删除记录</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
</div>
<div class="modal small fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog" style="width: 60%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">证书图片</h3>
            </div>
            <div class="modal-body">
                <div class="row" id="photos_show">
                </div>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
            </div>
        </div>
    </div>
</div>
<div class="modal small fade" id="delModel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">删除用户</h3>
            </div>
            <div class="modal-body">
                <p class="error-text"><i class="fa fa-warning modal-icon"></i>是否确定删除？</p>
                <p class="error-text">如果删除，将无法恢复！</p>
            </div>
            <div class="modal-footer">
                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Cancel</button>
                <button class="btn btn-danger" data-dismiss="modal" onclick="urlSubmit()">删除</button>
            </div>
        </div>
    </div>
</div>
<script src="/static/lib/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript">
    $("[rel=tooltip]").tooltip();
    $(function () {
        $('.demo-cancel-click').click(function () {
            return false;
        });
    });
</script>
{% if messages %}
    <script type="text/javascript">
        {% for msg in messages %}
            alert('{{ msg.message }}');
        {% endfor %}
    </script>
{% endif %}
</body>
</html>
